#!/bin/bash
branch_v=$1
date_stamp=`date "+%Y-%m-%d %H:%M:%S"`
date1=`date "+%Y-%m-%d-%H-%M-%S"`
echo "$brance_v" 
DIANSHU_WEBSITE_HOME=$HOME/tianwen-website-frontend/

rm -rf /www/tianwen-website/*
cp -r $DIANSHU_WEBSITE_HOME/dist/*   /www/tianwen-website
sudo nginx -s reload
cp -r /www/tianwen-website/  ~/tianwen-website-frontend/website-bak/tianwen-website$date1
################## cdn cos upload ####################
perl -w /www/tw_cos.pl && echo "cos upload compeleted"
send_weixin_v2   "【部署推送】\n【$date_stamp】\n【tianwen】\n【frontend-website/前端/】\n【测试环境】【tianwen-test/49.234.77.139】\n【$branch_v】 分支部署完成, 由 $2 用户构建部署,COS 上传已完成 "
